<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport"
    content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <title>Hello APP</title>
  <link rel="stylesheet" href="./css/bootstrap.min.css">
  <link rel="stylesheet" href="./css/style.css">
  <style>
    body {

      background-color: #fff;
    }

    .logodiv img {
      width: 240px;
      margin: 0 auto;
      display: block;
    }

    .logodiv {
      text-align: center;
    }

    .logodiv h1 {
      font-size: 1.2rem;
      color: #03357a;
      margin-top: 20px;
      margin-bottom: 50px;
    }

    .serviceitems {
      margin-top: 30px;
      padding-bottom: 0px;
    }

    .serviceitems a {
      background: #00b3f6;
      color: #fff;
      text-decoration: none;
      display: block;
      overflow: hidden;
      text-align: center;
      margin: 0 auto;
      height: 80px;
      border-radius: 15px;
      font-size: 1.3rem;
      display: flex;
      align-items: center !important;
      justify-content: center;
      margin-bottom: 25px;
      white-space: normal;
      word-wrap: break-word;
      text-overflow: clip;
    }
 
  </style>
</head>

<body class="wrap">
  <div id="app">
    <div class="container1 shadow-sm">

      <nav class="navbar navbar-expand-lg fixed-top navbar-light bg-header">
        <div class="container-fluid">
          <div class="baricon">
            <!-- <span style="width: 24px;" class="navbar-text"></span> -->
            <img width="60" src="./image/hhlogo.png">
          </div>

          <div id="navbarText">
            {{lan['ACC_WMS']}}
          </div>
          <div onclick="setting()" class="baricon">
            <img width="30" class="" src="./image/more.png">
          </div>
        </div>
      </nav>
    </div>


    <div class="logodiv">
      <div class="bannerlogo pt-1"></div>
      <!-- <img class="bannerlogo pt-3" src="./image/logo.jpeg"> -->
    </div>
    <div  class="container mt-2">

      <div class="row justify-content-center serviceitems">
        <!-- v-if="userMenu.SalesRep_W_PORcv_c && companyMenu.SalesRep_W_PORcv_c"  -->
        <div  v-if="userMenu.SalesRep_W_PORcv_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="buy_detial"
            :data-title="lan['Purchase_Receipt']" onclick="toNavWin2(this)"
            href="javascript:;">{{lan['Purchase_Receipt']}}</a>
        </div>
        <div v-if="userMenu.SalesRep_W_JobRcv_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="goods_receiving"
            :data-title="lan['Production_Receipt']" onclick="toNavWin2(this)"
            href="javascript:;">{{lan['Production_Receipt']}}</a>
        </div>
        <div v-if="userMenu.SalesRep_W_IssueMisc_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']"  data-login="1" data-frame="misc_issue"
            :data-title="lan['Misc_Issue']" onclick="toNavWin2(this)" href="javascript:;">{{lan['Misc_Issue']}}</a>
        </div>
        <div v-if="userMenu.SalesRep_W_CustShip_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="deliver_products"
            :data-title="lan['Customer_Shipment']" onclick="toNavWin2(this)"
            href="javascript:;">{{lan['Customer_Shipment']}}</a>
        </div>
        <div v-if="userMenu.SalesRep_W_PickingList_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="picking_list"
            :data-title="lan['Picking_List']" onclick="toNavWin2(this)" href="javascript:;">{{lan['Picking_List']}}</a>
        </div>
        <div v-if="userMenu.SalesRep_W_ReturnMtl_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="order_material_return"
            :data-title="lan['Order_Material_Return']" onclick="toNavWin2(this)"
            href="javascript:;">{{lan['Order_Material_Return']}}</a>
        </div>

        <div v-if="userMenu.SalesRep_W_Shelf_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="inventory_transfer" :data-title="lan['Shelves']"
            onclick="toNavWin2(this)" href="javascript:;">{{lan['Shelves']}}</a>
        </div>
        <div v-if="userMenu.SalesRep_W_InQuery_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="qty_ajment" :data-title="lan['Quantity_Adjustments']"
            onclick="toNavWin2(this)" href="javascript:;">{{lan['Quantity_Adjustments']}}</a>
        </div>

        <div v-if="userMenu.SalesRep_W_PORcv_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="po_rcv" data-title="PO  RCV Confirm"
            onclick="toNavWin2(this)" href="javascript:;">PO  RCV Confirm</a>
        </div>
        <div v-if="userMenu.SalesRep_W_CustShip_c" class="col-6 col-md-4">
          <a tapmode="" :data-right="lan['Scan']" data-login="1" data-frame="rma_receipts"
            :data-title="lan['RMA_Receipts']" onclick="toNavWin2(this)"
            href="javascript:;">{{lan['RMA_Receipts']}}</a>
        </div>
      </div>


      <div class="copyright mt-5 w-100">
        <div class="row" :gutter="10">
          <div  class="col-5" style="text-align: right;">{{lan['Version']}}：</div>
          <div  class="col-7">{{appVersion}}</div>
          <div  class="col-5"  style="text-align: right;">{{lan['Site']}}：</div>
          <div  class="col-7">{{siteName}}</div>
          <div  class="col-5"  style="text-align: right;">{{lan['Company']}}：</div>
          <div  class="col-7">{{companyName}}</div>
        </div>
      </div>

    </div>
  </div>



</body>
<script type="text/javascript" src="./script/lang.js"></script>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript" src="./script/vue.min.js"></script>
<script type="text/javascript" src="./script/layer/mobile/layer.js"></script>
<script type="text/javascript" src="./script/zepto.min.js"></script>
<script type="text/javascript" src="./script/common.js"></script>
<script type="text/javascript">
  var modulePda;
  const app = new Vue({
    el: '#app',
    data: {
      print_num: '',
      appVersion:'',
      siteName:'',
      companyName:'',
      uinfo:{},
      userMenu:{},
      companyMenu:{}
    },
    mounted() {

    },
    methods: {

    }
  });
  apiready = function () {
    api.parseTapmode();
    app.appVersion = api.appVersion;
    api.addEventListener({
        name: 'keyshow'
    }, function() {
        api.setFrameAttr({
            name: 'order_material',    
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: api.winHeight - api.safeArea.bottom
            }
        });
    });
    console.log('当前应用程序版本号为：' + app.appVersion);
    confirmPer('storage');
    confirmPer('camera');   
    userinfo = get_user_info();    
    app.uinfo = get_user_info();
    app.companyName = userinfo.CompanyName;
    app.siteName = userinfo.SiteName;
    console_debug(JSON.stringify(userinfo),88888);
    //getlan();
    userMenuPermsion()
    api.setStatusBarStyle({ style: 'light', color: 'transparent' });
    $(".bg-header").attr("style", "padding-top:" + api.safeArea.top + 'px;');
    var h = $(".bg-header").height();
    $(".logodiv").attr("style", "margin-top:" + h + 'px;');


    

    if (modelpda == 'tsc') {
      modulePda = api.require('moduleTsc');
    } else {
      modulePda = api.require('moduleZebra');
    }


    var privacyStatus = api.getPrefs({ sync: true, key: 'privacyStatus' });
    privacyStatus = parseInt(privacyStatus);
    if (!privacyStatus) {
      //privacyStatus1();
    }
    api.addEventListener({
      name: 'userinfo_update'
    }, function (ret, err) {
      location.reload();
      // loadData();
      userMenuPermsion();
      // localStorage.removeItem('PartNumList');
      loadWarehouseCodeData();
     
      app.companyName = userinfo.CompanyName;
    });

    api.addEventListener({
      name: 'resume'
    }, function (ret, err) {
      registerTsc();
    });
    api.addEventListener({
      name: 'pause'
    }, function (ret, err) {
      unregisterTsc();
    });
    user_Permissions_LicQty()
    // localStorage.removeItem('PartNumList');
    loadWarehouseCodeData();
    registerTsc();
    //privacyStatus1();

    //socket_test();
  };

  function registerTsc() {
  if (typeof modulePda !== "undefined") {
    modulePda.register({}, function (ret, err) {
      console_debug(ret, err);
    });
  }
}

function unregisterTsc() {
  if (typeof modulePda !== "undefined") {
    modulePda.unregister({}, function (ret, err) {
      console_debug(ret, err);
    });
  }
}
 
// 初始化selectpicker
function initializeSelectpicker() {
  setTimeout(function() {
    $('.myselect3').selectpicker();
  }, 500);
}

  function userMenuPermsion(){
    userinfo = get_user_info();
    console.log(JSON.stringify(JSON.stringify(userinfo)+"22222"))
    if (!userinfo.Token) {
      return;
    }
  
    api.ajax({
      url:server + 'BaqSvc/WMS_UserRights/?CompID='+userinfo.Company +'&UsersID='+userinfo.Name,
      method: 'get',
      returnAll: false,
      headers: {
        'Authorization': userinfo.Token,
      },
      data: {}  
    }, function(ret, err){
      console.log(JSON.stringify(ret),11111)
      console.log(JSON.stringify(err),22222)
      if(ret &&ret.value.length >0){
        app.userMenu = ret.value[0]
      }else{
        api.toast({
          msg:'获取用户权限列表失败',
          location: 'middle'
        })
      }
    })

  }
  

  function loadData() {
    userinfo = get_user_info();
    if (!userinfo.Token) {
      return;
    }
    api.ajax({
      url: server + 'BaqSvc/AMS_VendorID/',
      method: 'get',
      returnAll: false,
      headers: {
        'Authorization': userinfo.Token,
      },
      data: {
        values: {
          //'$select': 'VendorID,Name,VendorNum',
          '$filter': "Vendor_Company eq '" + userinfo.Company + "'"
        }
      }
    }, function (ret, err) {
      console.log(JSON.stringify(err),"00000")
      console.log(JSON.stringify(ret.value),3333)
      if (ret) {
        var arr = [];
        for (i in ret.value) {
          var row = {};
          row.VendorID = ret.value[i].Vendor_VendorID;
          row.Name = ret.value[i].Vendor_Name;
          row.VendorNum = ret.value[i].Vendor_VendorNum;
          arr.push(row);
        }
        api.setPrefs({
          key: 'Vendors',
          value: arr
        });
      }

    });
  }



  async function loadWarehouseCodeData() {
    userinfo = get_user_info();
    if (!userinfo.Token) {
      return;
    }
    await api.ajax({
      url: server + 'BaqSvc/WMS_Warehouse/?CompID='+ userinfo.Company +"&Site="+userinfo.Site,
      method: 'get',
      returnAll: false,
      headers: {
        'Authorization': userinfo.Token,
      },
      data: {
      
      }
    }, function (ret, err) {
      let jsonData = JSON.stringify(ret.value)
      if (ret) {
        api.setPrefs({
          key: 'WarehouseCode',
          value: jsonData
        });
        localStorage.setItem('WarehouseCode',jsonData)
      }

    });
  }



  function privacyStatus1() {
    var str = '<div style="text-align:left;padding:15px;"><p>请你务必审情阅读，充分理解”服务协议"';
    str += '和"隐私政策"各条款。包括但不限于:';
    str += '为了向你提供即时通讯，内容分享等服务。</p>';
    //str += '<p>我们需要收集你的设备信息，操作日志等个人信息。</p><p>你可以在“设置"中查看、变更、删除个人信息并管理你的授权。</p>';
    str += '<p>你可阅读<a style="color:blue;" tapmode  data-id="1723" data-title="服务协议" data-url="https://jcheuk56.wixsite.com/app-terms" onclick="toUrl(this)" href="javascript:;">《服务协议》</a>和<a style="color:blue;" tapmode  data-id="3" data-title="隐私条款" data-url="https://jcheuk56.wixsite.com/app-terms" onclick="toUrl(this)" href="javascript:;">《隐私政策》</a>了解详细信息。</p>';
    str += '<p>如你同意，请点击"同意”开始接受我们的服务。</p></div>';


    layer.open({
      title: '服务协议和隐私政策',
      shadeClose: false,
      content: str
      , closeBtn: false
      , btn: ['同意', '不同意']
      , yes: function (index, layero) {
        layer.closeAll();
        api.setPrefs({ key: 'privacyStatus', value: 1 });
        //initApp();
      }
      , btn2: function (index, layero) {
        layer.closeAll();
        api.setPrefs({ key: 'privacyStatus', value: 0 });
        api.closeWidget({
          id: 'A6168159593096',
          retData: {
            name: 'closeWidget'
          },
          animation: {
            type: 'flip',
            subType: 'from_bottom',
            duration: 500
          }
        });



      }
      , cancel: function () {
        //右上角关闭回调

        //return false 开启该代码可禁止点击该按钮关闭
      }
    });
  }

  function toNavWin3(ob) {
    var login = parseInt($(ob).data("login"))
    if (login) {
      userinfo = get_user_info();
      console_debug(userinfo, '');
      if (!userinfo.Token) {
        toLogin();
        return;
      }
    }
    var data = {};
    data.title = $(ob).data("title");
    data.frame = $(ob).data("frame");
    if (data.title == '加工進度') {
      data.type = 'process'
    } else {
      data.type = 'yanshou'
    }

    var right = $(ob).data("right");
    if (right) {
      data.right = [{
        text: right,//（可选项）按钮标题文字，可以和icon同时存在，字符串类型
        color: '#fff',//（可选项）按钮标题文字颜色，默认值#000，字符串类型
        //fontSize: //（可选项）按钮标题字体大小。默认值17，数字类型
        //fontWeight: //（可选项）按钮标题字体粗细，默认值normal。字符串类型。Android及iOS8.2以下系统只支持normal、bold，iOS8.2及以上系统支持normal、bold、bolder、lighter、100~900。
        //iconPath: //（可选项）按钮icon图标路径，可以和text同时存在，图片尺寸需要为4倍图，例如设备上面期望显示的图标尺寸为25*25，则图片实际尺寸需要为100*100，字符串类型
      }];
    }
    openNavWin2(data.frame, data);
  }

  function setting() {
    userinfo = get_user_info();
    console_debug(userinfo, '');
    if (!userinfo.Token) { toLogin(); return; }
    //var btns = ['注销登录','工程监工日报表'];
    var btns = [lan['Switch_Login'], lan['Setting'], "Print Setting"];
    api.actionSheet({
      title: lan['Tips'],
      cancelTitle: lan['Cancel'],
      buttons: btns
    }, function (ret, err) {
      var index = ret.buttonIndex;
      var key = index - 1;
      if (btns[key] == lan['Switch_Login']) {
        swichlogin();
      }
      if (btns[key] == lan['Setting']) {
        var data = {};
        data.title = '';
        data.frame = 'changeapi';
        openNavWin2(data.frame, data);
      }
      if (btns[key] == "Print Setting") {
        var data = {};
        data.title = '';
        data.frame = 'printtest';
        openNavWin2(data.frame, data);
      }
      if (btns[key] == '工程监工日报表') {
        var data = {};
        data.title = '工程监工日报表';
        data.frame = 'project';
        openNavWin2(data.frame, data);
      }

      if (btns[key] == '服务协议') {
        var data = {};
        data.title = '服务协议';
        data.url = 'https://jcheuk56.wixsite.com/app-terms';
        topageUrl(data);
      }

      if (btns[key] == '隐私政策') {
        var data = {};
        data.title = '隐私政策';
        data.url = 'https://jcheuk56.wixsite.com/app-terms';
        topageUrl(data);
      }


    });
  }


  function toSearch() {
    userinfo = get_user_info();
    console_debug(userinfo, '');
    if (!userinfo.Token) { toLogin(); return; }
    //var btns = ['注销登录','工程监工日报表'];
    var btns = [lan['Label_Search'], lan['Activity_Search'],lan['Inventory_Search']];
    api.actionSheet({
      title: lan['Tips'],
      cancelTitle: lan['Cancel'],
      buttons: btns
    }, function (ret, err) {
      var index = ret.buttonIndex;
      var key = index - 1;
      var data = {};
      if (btns[key] == lan['Label_Search']) {
        data.title = lan['Label_Search'];
        data.frame = 'barcode_search';
        openNavWin2(data.frame, data);
      }
      if (btns[key] == lan['Activity_Search']) {
        var data = {};
        data.title = lan['Activity_Search'];
        data.right = [{
          text: lan['Scan'],
          color: '#fff',
        }];
        data.frame = 'activity_search';
        openNavWin2(data.frame, data);
      }

      if(btns[key] == lan['Inventory_Search']){
        data.title = lan['Inventory_Search'];
        data.right = [{
          text: lan['Scan'],
          color: '#fff',
        }];
        data.frame = 'Inventory_Search';
        openNavWin2(data.frame, data);
      }


    });
  }


  function swichlogin() {
    let btns = [lan['Switch_Site'], lan['Log_Out']];
    api.actionSheet({
      title: lan['Tips'],
      cancelTitle: lan['Cancel'],
      buttons: btns
    }, function (ret, err) {
      var index = ret.buttonIndex;
      var key = index - 1;
      if (btns[key] == lan['Switch_Site']) {
        var data = {};
        data.title = lan['Switch_Site'];
        data.frame = 'swich_site';
        openNavWin2(data.frame, data);
        
      }
      if (btns[key] == lan['Log_Out']) {
        logout();
      }
    })
  }

  function logout(){
    api.confirm({
      title: lan['Tips'],
      msg: lan['Log_Out_Ask'],
      buttons: [lan['YES'], lan['NO']]
    }, function (ret, err) {
      var index = ret.buttonIndex;
      if (index == 1) {
        clear_userinfo();
        let data = {
          DeviceID: api.deviceId,
        }
        Loginout_Userdellic(data)
        //api.rebootApp();
        //api.sendEvent({name : 'reg_login_successEvent',extra : 'login'});
        //api.closeWin({});
      }
    });
  }


  function wificonnect(ip, port) {

    // alert(ip);
    var moduleTsc = api.require('moduleTsc');
    moduleTsc.connect({ "ip": ip, "port": port }, function (ret, err) {
      if (ret) {
        if (ret.status == 1) {
          api.sendEvent({
            name: 'print_connected',
            extra: 'update'
          });
        }
        if (ret.status == 2) {
          hideProgress();
          errMassage(ret.msg)
        }
      }
    });



  }


  function wificonnect3(ip, port) {

    var socketManager = api.require('socketManager');
    socketManager.createSocket({
      host: ip,
      port: port
    }, function (ret, err) {
      if (ret) {
        api.sendEvent({
          name: 'print_connected',
          extra: ret
        });
      } else {
        alert(JSON.stringify(err));
      }
    });



  }
  function socket_test() {
    var message = "^XA\n^CF0,60\n^BY4,3.0,120\n^FO50,50^B3N,N,120,N,N^FDPR-2022-192019013^FS\n^FO730,50^GFA,5900,5900,50,R01!R03!:R07!::R0!R0FB!Q01!:Q03!::Q07!:Q0!Q0SFE!P01!P01SFD7!P01SF7!P03!:P06DSF3!P07SFE1!P0TFC1!P0TFC0gOFE!P0TF80FD!O01TF807!O01TF007UFI0gQFE001!O03TF007RFBFK0OFM0SFEJ01!O03TF803SF8K01NFM01RFL03!O07TF803RFEM07MFN07PFCM0!O07SFDC01PFDFCM01MFN03PF8M03!O07TFC01RF8N0MFO0PFN01!O0UF400PFDFO03LFO07NFEO07FD!O0TF9E00QFBO01LFO03NFCO03DB!N01TF9E00PFDEI0IFJ0LFO01NFC001FFEI01E!N01TF8F007PFE007FFEEI07KF007IFE001BMFC00FEFFCI0B!N03TF0F007PF601IFDFC003KF007JF800NFC03FFBFFI06!N03TF0F803OFDA07KFE001KF007JFC00MFBC0LFC003!N03SFE07803OF9E0MF001KF007JFE007LF3C1MF001!N07SFE07803OF1E3MFC00KF007KF007KFE3C7DLF801!N07SFC03C01OF1E7MFE01KF007KF007JFDE3CNFC00!N0TFC03C01NFE1EOF07KF007KF807KFC3DFBLFE00E!N0TFC03E00NFC1PF0LF007KF803KF837NFE007!M01TF803E00NFC1FBNF9LF007KF803JFB83PF003!M01TF803F007MF81WF007KF803KF03PF803!M01TF007F007MF81WF007KF803KF03PF803!M03TF007F007MF81WF007KF803JFE03PFC01!M03TF00FF803MF01WF007KF803JFE03PFC01!M07SFE00BF803MF01WF007KF807JFE03PFE00!M07SFE01FFC01MF01WF007KF007JFE03PFE00!M0TFC01FDC01LFE01WF007KF007JFC03PFE00!M0TFC01DFE00LFE01WF007JFE00KFC03QF00!M0TF803FEE00LFE01WF007JFC00KFC03QF00!L01TF803FFE00LFE01WF007JFI0KFC03QF007!L01TF807IF007KFE01WF007IFC001KFC03QF007!L03TF007IF007KFE01WF007CK03KFC03QF007!L03TF00JF803KFE01WF0078K07KFC03QF007!L07SFE00JF803KFE01WF0078K0LFC03QF007!L07SFE00JFC01KFE01WF0078J01LFC03QF007!L07SFC01JFC01KFE00WF0078J03LFC03QF007!L0TFC01JFE01KFE00WF0078J0MFC01QF007!L0TFC03JFE00KFE00WF0078I03MFC01QF007!K01TF803JFE00KFE00DVF0078007NFC01QF00!K01TF807IFB7007JFE00WF007RFC01QF00!K03TF007JFB007KF00WF007FFBOFE01QF00!K03TF00LF803KF006VF007JFC7LFE00QF00!K03SFEM07803KF007VF007IF007LFE00QF00!K07SFEM07C03KF803VF007FF7003LFE007PF01!K07SFEM03C01KF803VF007IF801MF007PF01!K0TFCM03C01KF801VF007IFC01MF003PF03!K0TFCM01E00KFC01VF007IFC00MF803LFEFFD03!J01TF8M01E00KFC00DNF8LF007IFE007DKF801LFDIF07!J01TF8M01F007JFE007EMF07KF007JF003LFC00LF7IF07!J01TFO0F007JFE003MF603KF007JF803LFC00DMFE70D!J03TF007MF807JFB001MFC00KF007JF801LFE007LF7CF0E!J03TF00NF803KF800MF800KF007JFC00MF003MF8F1!J07SFE00NF803KF8007LF001KF007JFE007LFI0LFE0F3!J07SFE01NFC01KFC003KFC003KF007KF007LF8007KF80F7!J0TFC01NFC01KFEI0KFI07KF007KF003LFC001JFE00!J0TFC01NFE00KFBI01IFCI0LF007KF801LF6I03IF800!J0TF803NFE00KFD8J0F8I01DKF007KFC00MFJ03FJ0!I01TF803OF00KF7CO03LF007KFE00MF8O0!I01TF807OF007IFDFFO07BKF007JFBE007LFEO0!I03TF007OF007JFEF8M01MF007JF7F003DLFN03!I03TF00OFD803LFEM03MF007LF801MFCM07!I07TF00NFEF803MF8L0FFEKF807LFC01LFDFL01!I07TF80PFC01MFEK07NF807LFC00NFCK0!I07gVF7CI03PFEMFEDEOF8I07!I0gMFBgIF7!I0gOFBgHFD!001hRF7NFE!001gOF7SF7!003gNFDgJF7NF7NF7!003gPFBgFD!003!007!:00!:01!::03!:07!:0jXFE::1jXFE:3jXFC:7jXF87jWFE,7jVFE,^FS\n^CF0,30\n^FO50,200^APN,40,40^FDPart Number: 2022-02399494^FS\n^FO50,240^APN,40,40^FDIssue: 3^FS\n^FO50,280^APN,40,40^FDDescription: ^FS\n^FO50,320^APN,40,40^FDLot Num: 32132^FS\n^FO50,360^APN,40,40^FDProduct Group: 6FB^FS\n^FO50,400^APN,40,40^FDSupplier: William Smith & Sons Ltd^FS\n^FO50,440^APN,40,40^FDPO/Line: 0^FS\n^FO50,480^APN,40,40^FDRcv Date: ^FS\n^FO50,520^APN,40,40^FDExpiry Date: ^FS\n^BY2,3.0,10\n^XZ"
    var socketManager = api.require('socketManager');
    socketManager.createSocket({
      host: "192.168.1.4",
      port: 9100
    }, function (ret, err) {
      console_debug (ret, err);
      if (ret) {
        socketManager.write({
          sid: ret.sid,
          data: message
        }, function (ret1, err1) {
          console_debug (ret1, err1);
        });
      } else {
        alert(JSON.stringify(err));
      }
    });
  }

  function wificonnect2(mac) {

    //alert(mac);
    var moduleZebra = api.require('moduleZebra');
    moduleZebra.connect({ "mac": mac }, function (ret, err) {
      console_debug(ret, err);
      if (ret) {
        if (ret.status == 1) {
          api.sendEvent({
            name: 'print_connected',
            extra: 'update'
          });
        }
        if (ret.status == 2) {
          hideProgress();
          errMassage(ret.msg)
        }
      }
    });



  }


  function user_Permissions_LicQty() {
  var data1 = {
    "CompanyID": userinfo.Company,
    "PlantID": userinfo.Site,
    "UserName": userinfo.Name,
    "Password": userinfo.password,
    "Data": {},
  };
  api.ajax({
    url: wmsserver + 'getlicenceinfo/',
    method: 'post',
    returnAll: false,
    headers: {
      'token': wmstoken,
      'Content-Type': 'application/json;charset=utf-8'
    },
    data: {
      body: get_submit_data(data1)
    }
  }, function (ret, err) {
    console.log(JSON.stringify(ret),11111)
    if (ret) {
      localStorage.setItem('LicQty',ret.data.LicQty);

    }
  });
}
</script>

</html>